﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Frame.master" AutoEventWireup="true"
    CodeFile="employeeAction.aspx.cs" Inherits="employeeAction" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleHolder" runat="Server">
    <asp:Label runat="server" ID="lblTitle"></asp:Label>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="ContentHolder" runat="Server">

    <script type="text/javascript">
     function Display(obj) {
         document.getElementById(obj).style.display = 'block';
     }

     $(document).ready(function () {
         initJQueryWidgets();
     });

     function initJQueryWidgets() {
         $("[ID$=txtBirthDay]").datepicker({
             changeMonth: true,
             changeYear: true
         });
     }

//     Sys.WebForms.PageRequestManager.getInstance().add_endRequest(function () {
//         initJQueryWidgets();
//     }); 



 
     
    </script>

    <asp:Label ID="lblMsg" runat="server" ForeColor="#FF0000"></asp:Label>
    <table width="930" border="0" align="center" cellpadding="3" cellspacing="1" class="margin_l100">
        <tr>
            <td width="110" align="left" valign="top">
                Mã nhân viên
            </td>
            <td align="left" valign="top">
                <asp:UpdatePanel ID="UpnCode" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td align="left">
                                    <asp:TextBox ID="txtCode" runat="server" CssClass="width_200" 
                                      AutoPostBack="True" ontextchanged="txtCode_TextChanged" MaxLength="10"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="errorCode" runat="server" ControlToValidate="txtCode"
                                        CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True" Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                                <td align="left">
                                    <asp:UpdateProgress ID="UpdateProgress1" runat="server">
                                        <ProgressTemplate>
                                            <img src="images/spinner.gif" />
                                        </ProgressTemplate>
                                    </asp:UpdateProgress>
                                </td>
                                <td>
                                    <asp:Label ID="lblErrorCode" runat="server" CssClass="errorMsg" Text="Mã nhân viên này đã sử dụng !"
                                        Visible="False" ForeColor="#FF0000"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Họ và tên đệm
            </td>
            <td align="left" valign="top">
                <table cellpadding="0" cellspacing="0" border="0">
                    <tr>
                        <td align="left" width="110"><asp:TextBox ID="txtFirstName" runat="server" 
                                CssClass="width_100" MaxLength="50"></asp:TextBox></td>
                        <td align="center" width="30">Tên</td>
                         <td align="left" width="73"><asp:TextBox ID="txtLastName" runat="server" 
                                 CssClass="width_59" MaxLength="20"></asp:TextBox></td>
                         <td align="left"> <asp:RequiredFieldValidator ID="errorCode0" runat="server" ControlToValidate="txtFirstName"
                    CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True" Display="Dynamic">Nhập 
                Họ và tên đệm</asp:RequiredFieldValidator>
                &nbsp;<asp:RequiredFieldValidator ID="errorCode1" runat="server" ControlToValidate="txtLastName"
                    CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True" Display="Dynamic"
                    ErrorMessage="Nhập tên"></asp:RequiredFieldValidator></td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Tài khoản
            </td>
            <td align="left" valign="top">
                <asp:UpdatePanel ID="upnUser" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <table cellpadding="0" cellspacing="0" border="0">
                            <tr>
                                <td align="left">
                                    <asp:TextBox ID="txtUser" runat="server" CssClass="width_200" 
                                      AutoPostBack="True" ontextchanged="txtUser_TextChanged" MaxLength="50"></asp:TextBox>
                                    &nbsp;<asp:RequiredFieldValidator ID="errorUser" runat="server" ControlToValidate="txtUser"
                                        CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True" 
                                        Display="Dynamic"></asp:RequiredFieldValidator>
                                </td>
                                <td align="left">
                                    <asp:UpdateProgress ID="UpdateProgress2" runat="server" AssociatedUpdatePanelID="upnUser">
                                        <ProgressTemplate>
                                            <img src="images/spinner.gif" />
                                        </ProgressTemplate>
                                    </asp:UpdateProgress>
                                </td>
                                <td>
                                    <asp:Label ID="lblErrorUser" runat="server" CssClass="errorMsg" Text="Tài khoản này đã sử dụng !"
                                        Visible="False" ForeColor="Red"></asp:Label>
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr id="rowPass" runat="server">
            <td align="left" valign="top">
                Mật khẩu
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtPass" runat="server" CssClass="width_200" MaxLength="255" 
                    TextMode="Password"></asp:TextBox>
                &nbsp;<asp:RequiredFieldValidator ID="errorPass" runat="server" ControlToValidate="txtPass"
                    CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr id="rowConfirm" runat="server">
            <td align="left" valign="top">
                Xác nhận mật khẩu
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtConfirm" runat="server" CssClass="width_200" 
                    TextMode="Password" MaxLength="255"></asp:TextBox>
                &nbsp;<asp:CompareValidator ID="CompareValidator1" runat="server" ControlToCompare="txtPass"
                    ControlToValidate="txtConfirm" CssClass="errorMsg" ErrorMessage="Xác nhận mật khẩu không đúng !"></asp:CompareValidator>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Quyền
            </td>
            <td align="left" valign="top">
                <asp:DropDownList ID="cbxPermission" CssClass="width_204" runat="server" AppendDataBoundItems="True">
                    <asp:ListItem></asp:ListItem>
                </asp:DropDownList>
                &nbsp;<asp:RequiredFieldValidator ID="errorPermission" runat="server" ControlToValidate="cbxPermission"
                    CssClass="errorMsg" ForeColor="#FF0000" SetFocusOnError="True"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Email
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtEmail" runat="server" CssClass="width_200" MaxLength="50"></asp:TextBox>
                &nbsp;
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Giới tính
            </td>
            <td align="left" valign="top">
                <asp:RadioButtonList ID="rdoGender" runat="server" RepeatDirection="Horizontal">
                    <asp:ListItem Value="True" Selected="True"> Nam</asp:ListItem>
                    <asp:ListItem Value="False"> Nữ</asp:ListItem>
                </asp:RadioButtonList>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Ngày sinh
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtBirthDay" runat="server" CssClass="width_200"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                CMND
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtIDCard" runat="server" CssClass="width_200" MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Địa chỉ
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtAddress" runat="server" CssClass="width_200" Rows="3" 
                    TextMode="MultiLine" MaxLength="200"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Điện thoại
            </td>
            <td align="left" valign="top">
                <asp:TextBox ID="txtHandPhone" runat="server" CssClass="width_200" 
                    MaxLength="20"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                Chức vụ
            </td>
            <td align="left" valign="top">
                <asp:DropDownList ID="cbxPosition" runat="server" CssClass="width_204">
                    <asp:ListItem>
                    </asp:ListItem>
                    <asp:ListItem Value="Quản lý">Quản lý</asp:ListItem>
                    <asp:ListItem Value="Kế toán">Kế toán</asp:ListItem>
                    <asp:ListItem Value="Nhân viên">Nhân viên</asp:ListItem>
                    <asp:ListItem Value="Bảo vệ">Bảo vệ</asp:ListItem>
                    <asp:ListItem Value="Khác">Khác</asp:ListItem>
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td align="left" valign="top">
                &nbsp;
            </td>
            <td align="left" valign="top">
                <asp:ImageButton ID="btnSave" runat="server" ImageUrl="~/images/save.gif" OnClick="btnSave_Click" />
                <asp:ImageButton ID="btnReset" runat="server" ImageUrl="~/images/xoa.gif" 
                    OnClick="btnReset_Click" CausesValidation="False" />                
                <asp:ImageButton ID="btnCancel" runat="server" ImageUrl="~/images/huy.gif" 
                    OnClick="btnCancel_Click" CausesValidation="False" />
                
                &nbsp;<asp:HiddenField ID="hdnId" runat="server" />
                <asp:HiddenField ID="hdnCode" runat="server" />
            </td>
        </tr>
    </table>
</asp:Content>
